package com.aide.simplification.global.listener;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import com.aide.simplification.global.Utils;

/**
 * 
 * 
 * @author sorc
 * 
 */
public final class ContextListener implements ServletContextListener {

	public void contextDestroyed(ServletContextEvent servletContextEvent) {

	}

	public void contextInitialized(ServletContextEvent sce) {
		ServletContext sctx = sce.getServletContext();
		String physicsPath = sctx.getRealPath("/");
		physicsPath = physicsPath.replaceAll("\\\\", "/");
		Utils.saveConfig("physicsPath", physicsPath);
		Utils.saveConfig("contextPath", sctx.getContextPath());

	}
}